<!DOCTYPE html>
<!--管理用户界面-->
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:if="${bind}==null">病人标签绑定</title>
    <title th:if="${bind}">病人标签绑定编辑</title>
    <link rel="stylesheet" href="bindPage.css">
</head>
<body>

<h4>
    欢迎您：<text th:text="${session.doctorVO.name}"></text>&ensp;
    科室：<text th:text="${session.doctorVO.office}"></text>&ensp;
    权限：<text th:text="${session.doctorVO.role}"></text>
</h4>

<div class="select">
    <a href="/listAllPatient">
        <input type="submit" class="button" value="标签绑定">
    </a>
    <a href="/listAllTags">
        <input type="submit" class="button" value="标签管理">
    </a>
</div>
<hr>

<div class="title">
    <h2 style="font-size: xxx-large" th:if="${bind}==null">病人标签绑定</h2>
    <h2 style="font-size: xxx-large" th:if="${bind}">病人标签绑定编辑</h2>
</div>
<div class="list">
    <div class="text">
        <h3 class="inline">病人姓名：</h3>
        <span th:text="${patient.name}"/>
        <p></p>
        <h3 class="inline">标签名:</h3>
        <span type="text" name="tag_name" th:text="${tag.tag_name}"/>
        <p></p>
        <h3 class="inline">标签有效时间：</h3>
        <span name="tag_time" th:text="${tag.tag_start_time}+' ——> '+${tag.tag_end_time}"/>
        <p></p>
        <form th:if="${bind}==null" method="post" action="/createBind" enctype="multipart/form-data" id="createBind">
            <input type="hidden" name="bind_patient_id" th:value="${patient.id}">
            <input type="hidden" name="bind_tag_id" th:value="${tag.tag_id}">
            <input type="hidden" name="oid" th:value="${session.doctor.oid}">
            <input type="hidden" name="role" th:value="${session.doctor.role}">
            为<a th:text="${patient.name}"/>绑定<a th:text="${tag.tag_name}"/>
            有效期为：<input type="datetime-local" placeholder="请选择日期" name="bind_start_time" step="1" th:value="${#strings.substring(tag.tag_start_time,0,10)}+T+${#strings.substring(tag.tag_start_time,11,19)}">
            至<input type="datetime-local" placeholder="请选择日期" name="bind_end_time" step="1" th:value="${#strings.substring(tag.tag_end_time,0,10)}+T+${#strings.substring(tag.tag_end_time,11,19)}">
            <button>
                <a onclick="document:createBind.submit()">提交</a>   <!--提交-->
            </button>
            <a th:text="${bp_message}" style="color: red"></a>   <!--总信息-->
        </form>
        <form th:if="${bind}" method="post" action="/updateBind" enctype="multipart/form-data" id="updateBind">
            <input type="hidden" name="bind_id" th:value="${bind.bind_id}">
            <input type="hidden" name="oid" th:value="${session.doctor.oid}">
            <input type="hidden" name="role" th:value="${session.doctor.role}">
            为<a th:text="${patient.name}"/>绑定<a th:text="${tag.tag_name}"/>
            有效期为：<input type="datetime-local" placeholder="请选择日期" name="bind_start_time" step="1" th:value="${#strings.substring(bind.bind_start_time,0,10)}+T+${#strings.substring(bind.bind_start_time,11,19)}">
            至<input type="datetime-local" placeholder="请选择日期" name="bind_end_time" step="1" th:value="${#strings.substring(bind.bind_end_time,0,10)}+T+${#strings.substring(bind.bind_end_time,11,19)}">
            <button>
                <a onclick="document:updateBind.submit()">提交</a>   <!--提交-->
            </button>
            <a th:text="${bp_message}" style="color: red"></a>   <!--总信息-->
        </form>
    </div>
</div>



<script language="javascript" type="text/javascript">

</script>
</body>
</html>
